package com.itfenghuang.day15_作业;

import java.io.BufferedWriter;
import java.io.IOException;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.net.Socket;
import java.util.Scanner;

public class A02_客户端 {
    public static void main(String[] args) throws IOException {
        Scanner sc = new Scanner(System.in);
        Socket sk = new Socket("127.0.0.1",11112);
        OutputStream os = sk.getOutputStream();
        BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(os));
                while (true){
                    System.out.println("请输入");
                    String s = sc.nextLine();
                    try {
                        bw.write(s);
                        bw.newLine();
                        bw.flush();
                    } catch (IOException e) {
                        e.printStackTrace();
                    }
                }


    }
}
